package com.shisan.tingshu.account.client;

import com.shisan.tingshu.account.client.impl.UserAccountDegradeFeignClient;
import com.shisan.tingshu.common.result.Result;
import com.shisan.tingshu.model.account.RechargeInfo;
import com.shisan.tingshu.model.order.OrderInfo;
import com.shisan.tingshu.vo.account.AccountLockResultVo;
import com.shisan.tingshu.vo.account.AccountLockVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * 产品列表API接口
 */
@FeignClient(value = "service-account", fallback = UserAccountDegradeFeignClient.class, path = "/api/inner/accountinfo")
public interface UserAccountFeignClient {

    /**
     * 查询并锁定用户余额
     * @param accountLockVo
     * @return
     */
    @PostMapping("/checkAndLockAmount")
    Result<AccountLockResultVo> checkAndLockAmount(AccountLockVo accountLockVo);

    /**
     * 根据订单号查询充值信息
     * @param orderNo
     * @param userId
     * @return
     */
    @PostMapping("/getRechargeInfoByOrderNo/{orderNo}/{userId}")
    Result<RechargeInfo> getRechargeInfoByOrderNo(@PathVariable(value = "orderNo") String orderNo, @PathVariable(value = "userId") Long userId);
}